<template>
	<!-- 主页的组件 -->
	<div>
		<el-container>
			<RouterView></RouterView>
		</el-container>
	</div>

</template>

<script>
	import Axios from 'axios'
	// import router from "../route/index.js"
	export default { //js中 es6语法，模块 导出
		name: 'App',
		data() {
			return {
				admin: true,
				user: true,
				users: {},
				drawer: true,
				show: false,
				input: ''
			}
		},
		created() {
			this.getUsers();
		},
		methods: {
			zhuxiao() {
				sessionStorage.removeItem('users');
				// router.replace('/');
				location.reload();
			},
			getUsers() {
				console.log('App---调用getUser')
				let str = sessionStorage.getItem('users')
				if (str != null) {
					this.show = true; //欢迎可见
					//把字符串转换成对象 --- sessionStorage存的必须时字符串，所以取出来的也是字符串
					this.users = JSON.parse(str);
					if(this.users.role == 1){
						this.admin = false
					}else{
						this.user = false
					}
				}
			}
		}
	}
</script>

<style>
	.ms {
		text-decoration: none;
	}

	.el-main {
		color: var(--el-text-color-primary);
		text-align: center;
		margin: 0px auto;
		margin-top: 10px;
	}

	#txtTask {
		min-width: 15%;
	}

	h1 {
		font-size: 20px;
		color: #AAAAAA;
	}
</style>
